package com.community.owner.service.impl;

import com.community.common.exception.ServiceException;
import com.community.owner.domain.vo.OwnerBuildingsVO;
import com.community.owner.mapper.OwnerBuildingMapper;
import com.community.owner.service.BuildingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OwnerBuildingServiceImpl implements BuildingService {

    @Autowired
    private OwnerBuildingMapper buildingMapper;

    @Override
    public OwnerBuildingsVO getBuildingByOwnerId(Long ownerId) {
        if (ownerId == null) {
            throw new ServiceException("业主ID不能为空");
        }
        return buildingMapper.selectBuildingByOwnerId(ownerId);
    }
}
